﻿using System.Threading;
using System.Threading.Tasks;
using Xms.Abp.BackgroundJob;

namespace Xms.Abp.Messaging.Emailing;

/// <summary>
/// This service can be used simply sending emails.
/// </summary>
public interface IEmailSender
{
    /// <summary>
    /// Sends an email.
    /// </summary>
    Task SendAsync(EmailMessage emailMessage, CancellationToken stoppingToken = default);

    /// <summary>
    /// Adds an email to queue to send via background jobs.
    /// </summary>
    Task QueueAsync(EmailMessage emailMessage,
        BackgroundJobPriority priority = BackgroundJobPriority.Normal,
        CancellationToken stoppingToken = default);
}
